from django import forms
from .models import Score


class ScoreForm(forms.ModelForm):
    class Meta:
        model = Score
        fields = ['student', 'grade', 'subject', 'score', 'term']
        widgets = {
            'student': forms.Select(attrs={'class': 'form-input'}),
            'grade': forms.Select(attrs={'class': 'form-input'}),
            'subject': forms.TextInput(attrs={'class': 'form-input'}),
            'score': forms.NumberInput(attrs={'class': 'form-input', 'step': '0.01'}),
            'term': forms.TextInput(attrs={'class': 'form-input'}),
        }
